<style>
    .mask{
        position: fixed;
        z-index: 9999;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        display: none;
    }
    .maskDiv{
        position: absolute;
        z-index: 10000;
        width: 50%;
        top: 30%;
        left: 25%;
        background: #fff;
        display: none;
        margin-bottom: 150px;
    }
</style>
<script type="text/javascript">
    function showMask() {
        var mask = document.getElementsByClassName("mask")[0];
        mask.style.display="block";
    }

    function hideMask() {
        var mask = document.getElementsByClassName("mask")[0];
        mask.style.display="none";
    }
</script>
<div  class="mask"></div>